package data 
{
	import flash.utils.Dictionary;
	/**
	 * ...
	 * @author Roy
	 */
	public class GCShipData 
	{
		public static const SHIP_TYPE_SAILBOAT:uint = 0;
		public static const SHIP_TYPE_GALLEY:uint = 1;
		public static const SHIP_TYPE_BARGE:uint = 2;
		public static const SHIP_TYPE_STEAMBOAT:uint = 3;
		
		public static const STAT_SPEED:uint = 0;
		public static const STAT_DEFENSE:uint = 1;
		public static const STAT_NAVIGATION:uint = 2;
		public static const STAT_SLOTS:uint = 3;
		public static const STAT_HULL:uint = 4;
		public static const STAT_MAINTENANCE:uint = 5;
		public static const STAT_FUEL_EFFICIENCY:uint = 6;
		
		public static const NUM_STATS:uint = 6;
		
		private static var _information:Dictionary;
		
		public static function initialize():void
		{
			_information = new Dictionary();
			var name:String;
			var image:String;
			var description:String;
			var stats:Vector.<uint>;
			
			name = "Sailboat";
			image = "Sailboat";
			description = "A little toot-toot to get you across small bodies of water";
			stats = Vector.<uint>([20, 20, 20, 3, 50, 100, 0]);//[0,0,0,3,25,100,0]);
			_information[SHIP_TYPE_SAILBOAT] = new GCShipDataStruct(name, image, stats, description);
			
			name = "Galley";
			image = "Galley";
			description = "Bigger sails, beefier hull, ready to rock!";
			stats = Vector.<uint>([45, 45, 30, 5, 100, 60, 0]);//[30,30,10,5,100,60,0]);
			_information[SHIP_TYPE_GALLEY] = new GCShipDataStruct(name, image, stats, description);
			
			name = "Barge";
			image = "Barge";
			description = "Runs off coal to plow through the waves better with more goods";
			stats = Vector.<uint>([45,20,55,7,150,30,10]);
			_information[SHIP_TYPE_BARGE] = new GCShipDataStruct(name, image, stats, description);
			
			name = "Steamboat";
			image = "Steamboat";
			description = "Hot, steamy, and cruises across even the coldest waters";
			stats = Vector.<uint>([70,40,55,10,200,10,30]);
			_information[SHIP_TYPE_STEAMBOAT] = new GCShipDataStruct(name, image, stats, description);
		}
		
		public static function getNameFromId(id:uint):String
		{
			return (_information[id] as GCShipDataStruct)._name;
		}
		
		public static function getImageFromId(id:uint):String
		{
			return (_information[id] as GCShipDataStruct)._image;
		}
		
		public static function getDescriptionFromId(id:uint):String
		{
			return (_information[id] as GCShipDataStruct)._description;
		}
		
		public static function getStatsFromId(id:uint):Vector.<uint>
		{
			return (_information[id] as GCShipDataStruct)._stats;
		}
		
		public static function getStatName(stat:uint):String
		{
			switch (stat) {
				case STAT_DEFENSE:
					return "Defense";
				case STAT_FUEL_EFFICIENCY:
					return "Fuel Efficiency";
				case STAT_HULL:
					return "Hull capacity";
				case STAT_MAINTENANCE:
					return "Maintenance";
				case STAT_NAVIGATION:
					return "Navigation";
				case STAT_SLOTS:
					return "Upgrade Slots";
				case STAT_SPEED:
					return "Speed";
				default:
					return null;
			}
		}
	}

}